﻿using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

using IfSoft.OA.Entities;

namespace IfSoft.OA.DataAccess
{
    public class BankBillDetailMap : EntityTypeConfiguration<BankBillDetail>
    {
        public BankBillDetailMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties           
            // ... 

            // Table & Column Mappings
            this.ToTable("BankBillDetail");
            this.Property(t => t.Id).HasColumnName("Id");
            // ...

            // Relationships
            this.HasRequired(t => t.BankBill)
                .WithMany(t => t.BankBillDetails)
                .HasForeignKey(d => d.BankBillId);                       
        }
    }
}

